﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Microsoft.Reporting.WebForms;
using Anke.SHManage.MSSQLDAL;
using Anke.SHManage.BLL;


namespace Anke.SHManage.Web.Reports
{
    public partial class LS_WZJCXXWebForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitPage();
            }
        }

        private void InitPage()
        {   
            BindReportDataSource();
        }

        protected void btnsearch_click(object sender, EventArgs e)
        {
            
            BindReportDataSource();
            this.Material.Text = "";
        }

        protected void BindReportDataSource()
        {
            string sccj = Convert.ToString(this.sccj.Text);
            string gys = Convert.ToString(this.gys.Text);
            string enable = Convert.ToString(this.ddl.SelectedValue);
            string fl = Convert.ToString(this.MaterialType.Text);
            string wz = Convert.ToString(this.Material.Text);
          
            this.ReportViewer1.LocalReport.DataSources.Clear();
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/LS_WZJCXX.rdlc");


            LSDAL dal = new LSDAL();
            DataTable dt = dal.Get_LS_WZJCXX(sccj,gys ,enable, fl, wz);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetWZJCXXLS", dt));
            this.ReportViewer1.LocalReport.Refresh();
        }




    }
}



